Population class extension: population_options_defaults module

Module that contains the default options for the population grid code along with the description for these options, in the form of dictionaries:
  • population_options_defaults_dict: dictionary containing the default values for all the options

  • population_options_descriptions: dictionary containing the description for these options.

There are several other functions in this module, mostly to generate help texts or documents:
  • population_options_help: interactive function for the user to get descriptions for options

  • write_population_options_to_rst_file: function to generate the .rst document for the docs

With this its also possible to automatically generate a document containing all the setting names + descriptions.

All the options starting with _ should not be changed by the user except when you really know what you’re doing (which is probably hacking the code :P)

binarycpython.utils.population_extensions.population_options_defaults.callable_validation(value)[source]
binarycpython.utils.population_extensions.population_options_defaults.capsule_validation(value)[source]
binarycpython.utils.population_extensions.population_options_defaults.iterator_validation(value)[source]
class binarycpython.utils.population_extensions.population_options_defaults.population_options_defaults(**kwargs)[source]

Bases: object

Class extension to Population grid containing all the functionality for the options and defaults

build_description_table(table_name, parameter_list, description_dict)[source]

Function to create a table containing the description of the options

parse_description(description_dict)[source]

Function to parse the description for a given parameter

population_options_help(option)[source]

Function that prints out the description of a grid option. Useful function for the user.

Parameters

option (str) – which option you want to have the description of.

Return type

dict

Returns

dict containing the option, the description if its there, otherwise empty string. And if the key doesnt exist, the dict is empty

set_default_population_options()[source]

Function to load the population_options with the default values

set_validation_schema()[source]

Function to set the validation schema of the population_options

write_population_options_to_rst_file(output_file)[source]

Function that writes the descriptions of the grid options to an rst file

Parameters

output_file (str) – target file where the grid options descriptions are written to

Return type

None

binarycpython.utils.population_extensions.population_options_defaults.str_or_none_validation(value)[source]